﻿<%@ Control Language="C#" Inherits="System.Web.Mvc.ViewUserControl<PagedList<kysec.RAL.EFToMySql.tb_user>>" %>
<%@ Import Namespace="kysec.RAL.EFToMySql" %>
<%@ Import Namespace="Webdiyer.WebControls.Mvc"%>
<%if(Model.Count == 0){ %> 
    <span style="text-align:center; color:Red; font-size:16px; margin:0px 20px 0px 0px;">没有任何信息，请添加信息……</span><a href="<%=kysec.CR.MyUrl.WebData.WEBURL %>/User/AddUserInfo">新增用户</a>
<%}else{ %>
<table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#a8c7ce" onmouseover="changeto()"  onmouseout="changeback()">
  <tr>
    <td width="15%" height="20" bgcolor="d3eaef" class="STYLE6"><div align="center"><span class="STYLE10">用户名</span></div></td>
    <td width="15%" height="20" bgcolor="d3eaef" class="STYLE6"><div align="center"><span class="STYLE10">密码</span></div></td>
    <td width="8%" height="20" bgcolor="d3eaef" class="STYLE6"><div align="center"><span class="STYLE10">权限</span></div></td>
    <td width="10%" height="20" bgcolor="d3eaef" class="STYLE6"><div align="center"><span class="STYLE10">完善资料</span></div></td>
    <td width="12%" height="20" bgcolor="d3eaef" class="STYLE6"><div align="center"><span class="STYLE10">注册时间</span></div></td>
    <td width="8%" height="20" bgcolor="d3eaef" class="STYLE6"><div align="center"><span class="STYLE10">状态</span></div></td>
    <td width="10%" height="20" bgcolor="d3eaef" class="STYLE6"><div align="center"><span class="STYLE10">当前状态</span></div></td>
    <td width="20%" height="20" bgcolor="d3eaef" class="STYLE6"><div align="center"><span class="STYLE10">操作</span></div></td>
  </tr>
    <% foreach (kysec.RAL.EFToMySql.tb_user item in Model)
       { %>
  <tr>
    <td height="20" bgcolor="#FFFFFF" class="STYLE6"><div align="center"><span class="STYLE19"><%= Html.Encode(item.c_vc_userName) %></span></div></td>
    <td height="20" bgcolor="#FFFFFF" class="STYLE19"><div align="center"><input type="password" readonly="readonly" value="<%= kysec.CR.Common.EncodeByBase64.Encode(Html.Encode(item.c_vc_passWord)) %>" style="border:0;" /></div></td>
    <td height="20" bgcolor="#FFFFFF" class="STYLE19"><div align="center"><%string popStr = int.Parse(Html.Encode(item.c_i_pop).ToString()) == 1 ? "用户" : "管理员" ; %><%=popStr %></div></td>
    <td height="20" bgcolor="#FFFFFF" class="STYLE19"><div align="center"><%if (bool.Parse(Html.Encode(item.c_b_isDelete).ToString()))
                                                                            {%>请恢复<%}
                                                                            else
                                                                            { %><%if (bool.Parse(Html.Encode(item.c_b_isComplete).ToString()))
                                                                                               {%> 已完善<%}
                                                                                               else
                                                                                               {%><a href="/User/FinishUserInfo?userId=<%=kysec.CR.Common.EncodeByBase64.Encode((item.c_uq_userId).ToString()) %>" title="点击完善信息">未完善</a><%} %><%} %></div></td>
    <td height="20" bgcolor="#FFFFFF" class="STYLE19"><div align="center"> <%= Html.Encode(item.c_dt_regDate.ToShortDateString()) %></div></td>
    <td height="20" bgcolor="#FFFFFF" class="STYLE19"><div align="center"><%if (bool.Parse(Html.Encode(item.c_b_isDelete).ToString())){%>已删除<%}else{%>未删除<%} %></div></td>
    <td height="20" bgcolor="#FFFFFF" class="STYLE19"><div align="center"><%if (bool.Parse(Html.Encode(item.c_b_isOnline).ToString())){%> 在线<%} else{%>离线<%} %></div></td><%if (HttpContext.Current.Session["pop"].ToString().Equals("0")){ %>
    <td height="20" bgcolor="#FFFFFF"><div align="center" class="STYLE21"><%if (bool.Parse(Html.Encode(item.c_b_isDelete).ToString()))
                                                                            {%><a href="<%:kysec.CR.MyUrl.WebData.WEBURL %>/User/DeleteUserInfo?userId=<%:kysec.CR.Common.EncodeByBase64.Encode(item.c_uq_userId.ToString()) %>&isDelete=false">恢复</a><%}
                                                                            else
                                                                            { %><%if (item.c_b_isComplete)
                                                                                  { %> <%= Html.ActionLink("修改", "EditDetailInfo", new { id = kysec.CR.Common.EncodeByBase64.Encode((item.c_uq_userId).ToString()) })%><%}
                                                                                  else
                                                                                  { %><%= Html.ActionLink("修改", "EditBasicInfo", new { id = kysec.CR.Common.EncodeByBase64.Encode((item.c_uq_userId).ToString()) })%><%} %> | <%if (item.c_b_isComplete)
                                                                                                                                                                                                                                                                                                                                                                                                         { %><%= Html.ActionLink("查看", "Details", new { id = kysec.CR.Common.EncodeByBase64.Encode(item.c_uq_userId.ToString()) })%><%}
                                                                                                                                                                                                                                                                                                                                                                                                         else
                                                                                                                                                                                                                                                                                                                                                                                                         { %><%= Html.ActionLink("查看", "BasicInfo", new { id = kysec.CR.Common.EncodeByBase64.Encode(item.c_uq_userId.ToString()) })%><%} %> <%if (item.c_i_pop == 1)
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         { %>|&nbsp;<a href="<%:kysec.CR.MyUrl.WebData.WEBURL %>/User/DeleteUserInfo?userId=<%:kysec.CR.Common.EncodeByBase64.Encode(item.c_uq_userId.ToString()) %>&isDelete=true">删除</a> <%} %>|&nbsp;<%=Html.ActionLink("改密", "EditPwdInfo", new { id = kysec.CR.Common.EncodeByBase64.Encode(item.c_uq_userId.ToString()) })%><%} %></div></td><%}%>
  </tr> 
  <%} %>
</table>
<%} %>
<%=Html.AjaxPager(Model, new PagerOptions() { CssClass = "mvcPager", PageIndexParameterName = "id", ShowMorePagerItems = false, AlwaysShowFirstLastPageNumber = true, ShowPageIndexBox = true, PageIndexBoxWrapperFormatString = "页{0}" }, new AjaxOptions() { UpdateTargetId = "page" })%>

